﻿namespace Vdc.Grid
{
    using System;
    using System.ComponentModel;

    public class ColumnTemplateSettings : GridPersistentObject, ICloneable
    {
        public object Clone()
        {
            return new ColumnTemplateSettings { CancelTemporaryAddedRecord_TemplateId = this.CancelTemporaryAddedRecord_TemplateId, CancelTemporaryEditedRecord_TemplateId = this.CancelTemporaryEditedRecord_TemplateId, EditTemplateId = this.EditTemplateId, FilterTemplateId = this.FilterTemplateId, GroupHeaderTemplateId = this.GroupHeaderTemplateId, HeaderTemplateId = this.HeaderTemplateId, ModifyTemporaryAddedRecord_TemplateId = this.ModifyTemporaryAddedRecord_TemplateId, ModifyTemporaryEditedRecord_TemplateId = this.ModifyTemporaryEditedRecord_TemplateId, RemoveTemporaryAddedRecord_TemplateId = this.RemoveTemporaryAddedRecord_TemplateId, RowEditTemplateControlId = this.RowEditTemplateControlId, RowEditTemplateControlPropertyName = this.RowEditTemplateControlPropertyName, RowEditTemplateUseQuotes = this.RowEditTemplateUseQuotes, TemplateId = this.TemplateId, UndeleteTemporaryDeletedRecord_TemplateId = this.UndeleteTemporaryDeletedRecord_TemplateId };
        }

        object ICloneable.Clone()
        {
            return this.Clone();
        }

        [Description("The id of the template that is used for the \"Cancel | Remove\" buttons of the column (for the temporary added records)"), Category("Column Template Settings"), DefaultValue(""), Bindable(true)]
        public string CancelTemporaryAddedRecord_TemplateId
        {
            get
            {
                object obj2 = this.ViewState["CancelTemporaryAddedRecord_TemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["CancelTemporaryAddedRecord_TemplateId"] = value;
            }
        }

        [Description("The id of the template that is used for the \"Cancel | Delete\" buttons of the column (for the temporary edited records)"), DefaultValue(""), Bindable(true), Category("Column Template Settings")]
        public string CancelTemporaryEditedRecord_TemplateId
        {
            get
            {
                object obj2 = this.ViewState["CancelTemporaryEditedRecord_TemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["CancelTemporaryEditedRecord_TemplateId"] = value;
            }
        }

        [Description("The id of the template that is used for the column in edit mode."), Bindable(true), Category("Column Template Settings"), DefaultValue("")]
        public string EditTemplateId
        {
            get
            {
                object obj2 = this.ViewState["EditTemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["EditTemplateId"] = value;
            }
        }

        [Category("Column Template Settings"), Bindable(true), Description("The id of the template that is used for the filter of the column."), DefaultValue("")]
        public string FilterTemplateId
        {
            get
            {
                object obj2 = this.ViewState["FilterTemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["FilterTemplateId"] = value;
            }
        }

        [Bindable(true), Description("The id of the template that is used in the Header of the Groups."), Category("Column Template Settings"), DefaultValue("")]
        public string GroupHeaderTemplateId
        {
            get
            {
                object obj2 = this.ViewState["GroupHeaderTemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["GroupHeaderTemplateId"] = value;
            }
        }

        [Description("The id of the template that is used for the header of the column."), Bindable(true), Category("Column Template Settings"), DefaultValue("")]
        public string HeaderTemplateId
        {
            get
            {
                object obj2 = this.ViewState["HeaderTemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["HeaderTemplateId"] = value;
            }
        }

        [Description("The id of the template that is used for the \"Modify | Remove\" buttons of the column (for the temporary added records)"), Bindable(true), Category("Column Template Settings"), DefaultValue("")]
        public string ModifyTemporaryAddedRecord_TemplateId
        {
            get
            {
                object obj2 = this.ViewState["ModifyTemporaryAddedRecord_TemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["ModifyTemporaryAddedRecord_TemplateId"] = value;
            }
        }

        [Bindable(true), Category("Column Template Settings"), Description("he id of the template that is used for the \"Modify | Delete\" buttons of the column (for the temporary edited records)"), DefaultValue("")]
        public string ModifyTemporaryEditedRecord_TemplateId
        {
            get
            {
                object obj2 = this.ViewState["ModifyTemporaryEditedRecord_TemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["ModifyTemporaryEditedRecord_TemplateId"] = value;
            }
        }

        [Bindable(true), Category("Column Template Settings"), DefaultValue(""), Description("The id of the template that is used for the \"Remove\" button of the column (for the temporary added records)")]
        public string RemoveTemporaryAddedRecord_TemplateId
        {
            get
            {
                object obj2 = this.ViewState["RemoveTemporaryAddedRecord_TemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["RemoveTemporaryAddedRecord_TemplateId"] = value;
            }
        }

        [DefaultValue(""), Category("Column Template Settings"), Bindable(true), Description("The id of the control from the row template which will be used to update the column.")]
        public string RowEditTemplateControlId
        {
            get
            {
                object obj2 = this.ViewState["RowEditTemplateControlId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["RowEditTemplateControlId"] = value;
            }
        }

        [DefaultValue("value"), Bindable(true), Description("The name of the property of the control from the row template which will be used to update the column."), Category("Column Template Settings")]
        public string RowEditTemplateControlPropertyName
        {
            get
            {
                object obj2 = this.ViewState["RowEditTemplateControlPropertyName"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "value";
            }
            set
            {
                this.ViewState["RowEditTemplateControlPropertyName"] = value;
            }
        }

        [Description("If true, the value will be surrounded by double quotes."), DefaultValue(true), Bindable(true), Category("Column Template Settings")]
        public bool RowEditTemplateUseQuotes
        {
            get
            {
                object obj2 = this.ViewState["RowEditTemplateUseQuotes"];
                if (obj2 != null)
                {
                    return (bool) obj2;
                }
                if (!(this.RowEditTemplateControlPropertyName != "checked"))
                {
                    return false;
                }
                return true;
            }
            set
            {
                this.ViewState["RowEditTemplateUseQuotes"] = value;
            }
        }

        [Bindable(true), Category("Column Template Settings"), DefaultValue(""), Description("The id of the template that is used for the column.")]
        public string TemplateId
        {
            get
            {
                object obj2 = this.ViewState["TemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["TemplateId"] = value;
            }
        }

        [Bindable(true), Description("The id of the template that is used for the \"Undelete\" button of the column (for the temporary deleted records)"), Category("Column Template Settings"), DefaultValue("")]
        public string UndeleteTemporaryDeletedRecord_TemplateId
        {
            get
            {
                object obj2 = this.ViewState["UndeleteTemporaryDeletedRecord_TemplateId"];
                if (obj2 != null)
                {
                    return obj2.ToString();
                }
                return "";
            }
            set
            {
                this.ViewState["UndeleteTemporaryDeletedRecord_TemplateId"] = value;
            }
        }
    }
}

